package com.ssy.lingxi.settle.accounts.entity;

import com.ssy.lingxi.settle.accounts.handler.converter.JpaJsonToInvoiceProveBOConverter;
import com.ssy.lingxi.settle.accounts.model.bo.InvoiceProveBO;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * 会员收据发票凭证DO
 * @author 伍将
 * @date 2020/10/28
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "sa_member_receipt_invoice_proof",
        indexes = {@Index(name = "sa_member_receipt_invoice_proof_invoice_id_idx", columnList = "receiptInvoiceId")})
public class MemberReceiptInvoiceProveDO implements Serializable {

    private static final long serialVersionUID = -8706752188488459351L;
    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "member_receipt_invoice_proof_seq")
    @SequenceGenerator(sequenceName = "sa_member_receipt_invoice_proof_seq", name = "member_receipt_invoice_proof_seq", allocationSize = 1)
    private Long id;

    /**
     * 开票id
     */
    @Column(columnDefinition = "int8")
    private Long receiptInvoiceId;

    /**
     * 发票种类:1.增值税普通发票（默认） 2.增值税专用发票
     */
    @Column(columnDefinition = "int")
    private Integer kind;


    /**
     * 发票类型:1.企业（默认） 2.个人
     */
    @Column(columnDefinition = "int")
    private Integer type;

    /**
     * 发票抬头
     */
    @Column(columnDefinition = "varchar(40)")
    private String invoiceTitle;

    /**
     * 纳税号
     */
    @Column(columnDefinition = "varchar(20)")
    private String taxNo;

    /**
     * 开户行
     */
    @Column(columnDefinition = "varchar(40)")
    private String bankOfDeposit;

    /**
     * 账号
     */
    @Column(columnDefinition = "varchar(40)")
    private String account;

    /**
     * 地址
     */
    @Column(columnDefinition = "varchar(80)")
    private String address;

    /**
     * 电话
     */
    @Column(columnDefinition = "varchar(20)")
    private String tel;

    /**
     * 订单编号
     */
    @Column(columnDefinition = "varchar(20)")
    private String orderNo;

    /**
     * 原开票证明
     */
    @Convert(converter = JpaJsonToInvoiceProveBOConverter.class)
    @Column(columnDefinition = "jsonb")
    private List<InvoiceProveBO> originalInvoiceProveList;

    /**
     * 开票证明
     */
    @Convert(converter = JpaJsonToInvoiceProveBOConverter.class)
    @Column(columnDefinition = "jsonb")
    private List<InvoiceProveBO> invoiceProveList;

    public List<InvoiceProveBO> getOriginalInvoiceProveList() {
        return originalInvoiceProveList;
    }

    public void setOriginalInvoiceProveList(List<InvoiceProveBO> originalInvoiceProveList) {
        this.originalInvoiceProveList = originalInvoiceProveList;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Long getReceiptInvoiceId() {
        return receiptInvoiceId;
    }

    public void setReceiptInvoiceId(Long receiptInvoiceId) {
        this.receiptInvoiceId = receiptInvoiceId;
    }

    public Integer getKind() {
        return kind;
    }

    public void setKind(Integer kind) {
        this.kind = kind;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getInvoiceTitle() {
        return invoiceTitle;
    }

    public void setInvoiceTitle(String invoiceTitle) {
        this.invoiceTitle = invoiceTitle;
    }

    public String getTaxNo() {
        return taxNo;
    }

    public void setTaxNo(String taxNo) {
        this.taxNo = taxNo;
    }

    public String getBankOfDeposit() {
        return bankOfDeposit;
    }

    public void setBankOfDeposit(String bankOfDeposit) {
        this.bankOfDeposit = bankOfDeposit;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public List<InvoiceProveBO> getInvoiceProveList() {
        return invoiceProveList;
    }

    public void setInvoiceProveList(List<InvoiceProveBO> invoiceProveList) {
        this.invoiceProveList = invoiceProveList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
